using System.Drawing;
using DevExpress.XtraReports.UI;
using Waker.Common;

namespace Waker.Reports
{
    public partial class ReportClass : Base.ReportBase
    {
        public ReportClass()
        {
            InitializeComponent();
            this.BeforePrint += new System.Drawing.Printing.PrintEventHandler(ReportClass_BeforePrint);
            this.DesignerLoaded += new DevExpress.XtraReports.UserDesigner.DesignerLoadedEventHandler(ReportClass_DesignerLoaded);
        }

        void ReportClass_DesignerLoaded(object sender, DevExpress.XtraReports.UserDesigner.DesignerLoadedEventArgs e)
        {
            ReportUtil.InitDetailsBasedonXRTable(this, null);
        }

        void ReportClass_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            ReportUtil.InitDetailsBasedonXRTable(this, null);
            XRLine xrLine1 = new XRLine();
            xrLine1.Width = PageWidth - (this.Margins.Left + this.Margins.Right);
            xrLine1.Location = new Point(0, 0);
            this.Bands[BandKind.PageHeader].Controls.Add(xrLine1);
        }


    }
}
